from typing import List

input = [0,0,1,1,1,2,2,3,3,4]

def dedup(input:List[int])->int:
    s = 0
    if not input:
        return 0
    for f in range(len(input)):
        if input[f] != input[s]:
            s += 1
            input[s] = input[f]

    return s+1

print(input[:dedup(input)])